{template file="member/header.html"/}
<div class="layui-tab layui-tab-brief" lay-filter="user">
    <ul class="layui-tab-title">
        <li lay-id="" class="layui-this">发消息</li>
    </ul>
    <div class="layui-tab-content" style="padding: 20px 0;">
        <div class="layui-tab-item layui-show">
            <form class="layui-form layui-form-pane">
                <div class="layui-form-item">
                    <label class="layui-form-label">收信人</label>
                    <div class="layui-input-inline">
                        <input type="text" name="info[send_to]" lay-verify="required" placeholder="请输入收信人" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">标 题</label>
                    <div class="layui-input-inline">
                        <input type="text" name="info[subject]" lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item layui-form-text" style="max-width: 500px;">
                    <label class="layui-form-label">内 容</label>
                    <div class="layui-input-block">
                        <textarea name="info[content]" lay-verify="required" placeholder="请输入内容" class="layui-textarea"></textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">验证码</label>
                    <div class="layui-input-inline">
                        <input type="text" name="verify" lay-verify="required" placeholder="验证码" autocomplete="off" class="layui-input">
                    </div>
                    <div class="layui-input-inline">
                        <img id="verify" src="{:captcha_src()}" alt="验证码" class="captcha">
                    </div>
                </div>
                <div class="layui-form-item">
                    <button class="layui-btn" lay-submit data-type="layui-form" data-refresh="true">立即提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </form>
        </div>
    </div>
</div>
{template file="member/layui.html"/}
<script type="text/javascript">
layui.use(['form', 'layer','yznForm'], function() {
    var form = layui.form,
        layer = layui.layer,
        yznForm = layui.yznForm;

        yznForm.listen('', function (res) {
            layer.msg(res.msg, {
                offset: '15px',
                icon: 1,
                time: 1000
            }, function() {
                window.location.href = res.url;
            });
            return false;
        }, function (res) {
            //刷新验证码
            $("#verify").click();
        });
});
//刷新验证码
$("#verify").click(function() {
    var verifyimg = $("#verify").attr("src");
    $("#verify").attr("src", verifyimg.replace(/\?.*$/, '') + '?' + Math.random());
});
</script>
{template file="member/footer.html"/}